<%- include ('../public/page_header.ejs')%>

<div class="container-fluid">
  <div class="row">

    <div class="panel panel-default">
      <div class="panel-heading clear">
              <span>类型----<%= goodsType.title %></span> 
              
              <a href="/<%= config.adminPath %>/goodsTypeAttribute/add?_id=<%= goodsType._id %>" class="btn btn-primary fr">增加商品类型属性</a>
      </div>
    </div>

    <div class="table-responsive">
      <table class="table table-bordered">
        <thead>
          <tr class="th">
            <th>属性名称</th>
            <th>商品类型</th>
            <th>属性值的录入方式</th>                                
            <th>可选值列表</th>          
            <th>增加时间</th>  
            <th class="text-center">状态</th>                                                
            <th class="text-center">操作</th>
          </tr>
        </thead>
        <tbody>
          <% for (var i=0;i<list.length;i++) { %>
            <tr>
              <td><%= list[i].title %></td>
              <td><%= goodsType.title %></td>
              <td><% if(list[i].attr_type==1) { %>
                      单行文本框
                  <% } else if (list[i].attr_type==2) { %>
                      多行文本框
                  <% } else if (list[i].attr_type==3) { %>  
                      select下拉框
                  <% } %>
              </td>
              <td><%= list[i].attr_value %></td>
              <td><%= helper.formatTime(list[i].add_time) %></td>
              <td  class="text-center">
                <%if(list[i].status==1){%>
                        <img src="/static/admin/images/yes.gif" onclick="app.changeStatus(this,'goodsTypeAttribute','status','<%=list[i]._id%>', '<%=config.adminPath%>')" />
                <%}else{%>
                        <img src="/static/admin/images/no.gif" onclick="app.changeStatus(this,'goodsTypeAttribute','status','<%=list[i]._id%>', '<%=config.adminPath%>')" />
                <%}%>

              </td>    

              <td class="text-center">  
                <a href="/<%= config.adminPath %>/goodsTypeAttribute/edit?_id=<%= list[i]._id %>">修改</a>   &nbsp;&nbsp;&nbsp;             
                <a class="delete" href="/<%= config.adminPath %>/goodsTypeAttribute/delete?_id=<%= list[i]._id %>&cate_id=<%= goodsType._id %>">删除</a>    
         
              </td>
            </tr>
          <% } %>
        </tbody>
      </table>
        
    </div>
  </div>
</div>

</body>
</html>